using System;
using System.Data.Entity.ModelConfiguration;
using System.Data.Common;
using System.Data.Entity;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using HISModels.Entities;

namespace HISModels.Mapping
{
	public class VDoctorMap : EntityTypeConfiguration<VDoctor>
	{
		public VDoctorMap()
		{
			// Primary Key
			this.HasKey(t => t.Id);

			// Properties
			this.Property(t => t.Id)
				.HasDatabaseGeneratedOption(DatabaseGeneratedOption.None);
				
			this.Property(t => t.CodeValue)
				.HasMaxLength(50);
				
			this.Property(t => t.FirstName)
				.HasMaxLength(50);
				
			this.Property(t => t.LastName)
				.HasMaxLength(50);
				
			this.Property(t => t.EmployeeNumber)
				.HasMaxLength(50);
				
			this.Property(t => t.PhoneNumber)
				.HasMaxLength(50);
				
			this.Property(t => t.Email)
				.HasMaxLength(50);
				
			this.Property(t => t.NameValue)
				.HasMaxLength(50);
				
			this.Property(t => t.Expr1)
				.HasMaxLength(50);
				
			this.Property(t => t.Expr2)
				.HasMaxLength(50);
				
			// Table & Column Mappings
			this.ToTable("VDoctors");
			this.Property(t => t.Id).HasColumnName("Id");
			this.Property(t => t.CodeValue).HasColumnName("CodeValue");
			this.Property(t => t.FirstName).HasColumnName("FirstName");
			this.Property(t => t.LastName).HasColumnName("LastName");
			this.Property(t => t.EmployeeStatus).HasColumnName("EmployeeStatus");
			this.Property(t => t.EmployeeNumber).HasColumnName("EmployeeNumber");
			this.Property(t => t.EmployeeTypeId).HasColumnName("EmployeeTypeId");
			this.Property(t => t.PhoneNumber).HasColumnName("PhoneNumber");
			this.Property(t => t.Email).HasColumnName("Email");
			this.Property(t => t.NameValue).HasColumnName("NameValue");
			this.Property(t => t.Expr1).HasColumnName("Expr1");
			this.Property(t => t.Expr2).HasColumnName("Expr2");
		}
	}
}

